//
// CEvent3dMouseListener.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CVector;

public class CEvent3dMouseListener {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CEvent3dMouseListener(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CEvent3dMouseListener obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CEvent3dMouseListener(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CEvent3dMouseListener() {
    this(nel3dJNI.new_CEvent3dMouseListener(), true);
  }

  public void setMatrix(SWIGTYPE_p_NLMISC__CMatrix matrix) {
    nel3dJNI.CEvent3dMouseListener_setMatrix(swigCPtr, this, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(matrix));
  }

  public void setModelMatrix(SWIGTYPE_p_NLMISC__CMatrix matrix) {
    nel3dJNI.CEvent3dMouseListener_setModelMatrix(swigCPtr, this, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(matrix));
  }

  public void setFrustrum(CFrustum frustrum) {
    nel3dJNI.CEvent3dMouseListener_setFrustrum(swigCPtr, this, CFrustum.getCPtr(frustrum), frustrum);
  }

  public void setViewport(CViewport viewport) {
    nel3dJNI.CEvent3dMouseListener_setViewport(swigCPtr, this, CViewport.getCPtr(viewport), viewport);
  }

  public void setHotSpot(CVector hotSpot) {
    nel3dJNI.CEvent3dMouseListener_setHotSpot(swigCPtr, this, CVector.getCPtr(hotSpot), hotSpot);
  }

  public void setMouseMode(SWIGTYPE_p_TMouseMode mouseMode) {
    nel3dJNI.CEvent3dMouseListener_setMouseMode(swigCPtr, this, SWIGTYPE_p_TMouseMode.getCPtr(mouseMode));
  }

  public void enableModelMatrixEdition(boolean enable) {
    nel3dJNI.CEvent3dMouseListener_enableModelMatrixEdition__SWIG_0(swigCPtr, this, enable);
  }

  public void enableModelMatrixEdition() {
    nel3dJNI.CEvent3dMouseListener_enableModelMatrixEdition__SWIG_1(swigCPtr, this);
  }

  public void setModelMatrixRotationAxis(CEvent3dMouseListener.TAxis axis) {
    nel3dJNI.CEvent3dMouseListener_setModelMatrixRotationAxis(swigCPtr, this, axis.swigValue());
  }

  public CEvent3dMouseListener.TAxis getModelMatrixRotationAxis() {
    return CEvent3dMouseListener.TAxis.swigToEnum(nel3dJNI.CEvent3dMouseListener_getModelMatrixRotationAxis(swigCPtr, this));
  }

  public void enableModelTranslationAxis(CEvent3dMouseListener.TAxis axis, boolean enabled) {
    nel3dJNI.CEvent3dMouseListener_enableModelTranslationAxis(swigCPtr, this, axis.swigValue(), enabled);
  }

  public boolean isModelTranslationEnabled(CEvent3dMouseListener.TAxis axis) {
    return nel3dJNI.CEvent3dMouseListener_isModelTranslationEnabled(swigCPtr, this, axis.swigValue());
  }

  public void setModelMatrixTransformMove(SWIGTYPE_p_NLMISC__CMatrix transModelMove) {
    nel3dJNI.CEvent3dMouseListener_setModelMatrixTransformMove(swigCPtr, this, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(transModelMove));
  }

  public void getModelMatrixTransformMove(SWIGTYPE_p_NLMISC__CMatrix transModelMove) {
    nel3dJNI.CEvent3dMouseListener_getModelMatrixTransformMove(swigCPtr, this, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(transModelMove));
  }

  public void enableTranslateXYInWorld(boolean enabled) {
    nel3dJNI.CEvent3dMouseListener_enableTranslateXYInWorld(swigCPtr, this, enabled);
  }

  public boolean isTranslateXYInWorldEnabled() {
    return nel3dJNI.CEvent3dMouseListener_isTranslateXYInWorldEnabled(swigCPtr, this);
  }

  public void setSpeed(float speed) {
    nel3dJNI.CEvent3dMouseListener_setSpeed(swigCPtr, this, speed);
  }

  public SWIGTYPE_p_NLMISC__CMatrix getViewMatrix() {
    return new SWIGTYPE_p_NLMISC__CMatrix(nel3dJNI.CEvent3dMouseListener_getViewMatrix(swigCPtr, this), false);
  }

  public SWIGTYPE_p_NLMISC__CMatrix getModelMatrix() {
    return new SWIGTYPE_p_NLMISC__CMatrix(nel3dJNI.CEvent3dMouseListener_getModelMatrix(swigCPtr, this), false);
  }

  public CVector getHotSpot() {
    return new CVector(nel3dJNI.CEvent3dMouseListener_getHotSpot(swigCPtr, this), true);
  }

  public void addToServer(SWIGTYPE_p_NLMISC__CEventServer server) {
    nel3dJNI.CEvent3dMouseListener_addToServer(swigCPtr, this, SWIGTYPE_p_NLMISC__CEventServer.getCPtr(server));
  }

  public void removeFromServer(SWIGTYPE_p_NLMISC__CEventServer server) {
    nel3dJNI.CEvent3dMouseListener_removeFromServer(swigCPtr, this, SWIGTYPE_p_NLMISC__CEventServer.getCPtr(server));
  }

  public final static class TAxis {
    public final static TAxis xAxis = new TAxis("xAxis", nel3dJNI.CEvent3dMouseListener_xAxis_get());
    public final static TAxis yAxis = new TAxis("yAxis", nel3dJNI.CEvent3dMouseListener_yAxis_get());
    public final static TAxis zAxis = new TAxis("zAxis", nel3dJNI.CEvent3dMouseListener_zAxis_get());

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TAxis swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TAxis.class + " with value " + swigValue);
    }

    private TAxis(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TAxis(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TAxis(String swigName, TAxis swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TAxis[] swigValues = { xAxis, yAxis, zAxis };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
